/**
 * @Title: BaseAction.java 
 * @Package com.qtong.cms.commons 
 * @Description: TODO 
 * @author wangxi_qt
 * @date 2014-1-3 下午04:24:52 
 * @version V1.0 
 */
package com.bh.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

/**
 * @Title: BaseAction.java 
 * @Package com.qtong.cms.commons 
 * @Description: TODO 
 * @author wangxi_qt
 * @date 2014-1-3 下午04:24:52 
 * @version V1.0 
 */
public class BaseAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static Logger log=Logger.getLogger(BaseAction.class);

	protected void out(String string) {
		HttpServletResponse resp=ServletActionContext.getResponse();
		
		resp.setCharacterEncoding("utf-8");
		resp.setContentType("text/html;charset=utf-8");
		if (string==null) {
			string="";
		}
		try {
			log.info(string);
			PrintWriter pw = resp.getWriter();
			pw.print(string);
			pw.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			//e.printStackTrace();
			log.error(e);
		}finally{
		}
	}
	
}
